package com.dlwx.firefighting.views;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.dlwx.firefighting.R;
import com.dlwx.firefighting.adapter.LogisticsAdapter;
import com.flyco.dialog.widget.base.BottomBaseDialog;
import com.github.jdsjlzx.recyclerview.LRecyclerView;
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2018/3/19.
 */

public class LogisticsDialog extends BottomBaseDialog {
    Context context;
    @BindView(R.id.ll_logistics)
    LinearLayout llLogistics;
    @BindView(R.id.recyclerView)
    LRecyclerView recyclerView;
    private Unbinder unbinder;
    private LogisticsAdapter mAdapter;

    public LogisticsDialog(Context context) {
        super(context);
        this.context=context;
    }

    @Override
    public View onCreateView() {
        View view = LayoutInflater.from(context).inflate(R.layout.dialog_logistics, null);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void setUiBeforShow() {
        mAdapter=new LogisticsAdapter(context);
        recyclerView.setLayoutManager(new LinearLayoutManager(context));
        List<String> mdatas=new ArrayList<>();
        for (int i = 0; i <8 ; i++) {
            mdatas.add("");
        }
        mAdapter.setDataList(mdatas);
        LRecyclerViewAdapter lRecyclerViewAdapter=new LRecyclerViewAdapter(mAdapter);
        recyclerView.setAdapter(lRecyclerViewAdapter);
    }

    @OnClick(R.id.ll_logistics)
    public void onViewClicked() {
        this.dismiss();
    }
}
